package main;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;

public class Strings implements Iterator<String> {
  private BufferedReader source;
  private String line;

  public Strings(File sourceFile) {
    try {
      source = new BufferedReader(new FileReader(sourceFile));
    } catch (FileNotFoundException e) {
      throw new RuntimeException(e);
    }
  }

  @Override
  public boolean hasNext() {
    try {
      line = source.readLine();
      return line != null;
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  @Override
  public String next() {
    return line;
  }

  @Override
  public void remove() {
    throw new UnsupportedOperationException();
  }
}
